<% @Language=VBSCRIPT %>
<% 

' declare variables
Dim accessDB
Dim conn
Dim rst
Dim sql

' name of the database
accessDB="Northwind" 

' establish connection to the database
conn="DRIVER={Microsoft Access Driver (*.mdb)};"
conn=conn & "DBQ=" & Server.Mappath(accessDB)

' Create a Recordset
Set rst = Server.CreateObject("ADODB.Recordset")

' select all records from Employees table
' for indicated fields only
sql = "SELECT FirstName, LastName, Title, City, Country FROM Employees" 

' Open Recordset (and execute SQL statement above)
' using the open connection
rst.Open sql, conn

%>

<HTML>
<HEAD>
<TITLE>Northwind Employees</TITLE>
</HEAD>

<BODY>
<TABLE Border="1">
              
	<% 
       For Each fld in rst.Fields
	%>
	   <TH>
	    <% Response.Write fld.Name %>
	   </TH>
        <%
         Next
         rst.MoveFirst
       Do While Not rst.EOF
       %>
      <TR>
	  <% 
	  For Each fld in rst.Fields
	  %>
	   <TD>
          <% Response.Write fld.Value %>
       </TD>
      <% Next %>
      </TR>
      <% rst.MoveNext
      Loop
      %>
</TABLE>
</BODY>
</HTML>
<%
' close the Recordset
rst.Close
Set rst=Nothing
%>
